<script setup lang="ts">
import type { GlobalTheme } from 'naive-ui'
import { loadLocalFontFace, loadRemoteFontFace } from '@common/assets'

import themeJson from '@common/assets/theme/naive-ui-theme.json'
import { dateZhCN, zhCN } from 'naive-ui'

if (import.meta.env.MODE === 'production') {
  loadRemoteFontFace()
} else {
  loadLocalFontFace()
}

const theme = ref<GlobalTheme | null>(null)
</script>

<template>
  <n-config-provider
    inline-theme-disabled
    preflight-style-disabled
    :theme-overrides="themeJson"
    :theme="theme"
    :locale="zhCN"
    :date-locale="dateZhCN"
  >
    <n-global-style />

    <Suspense>
      <RouterView />
    </Suspense>
  </n-config-provider>
</template>
